<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<jsp:include page="/_layout/_css.jsp"/>
<link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
<script type="text/javascript">
	
</script>
</head>
<body class="gray-bg">
	<div class="ibox float-e-margins">
		<div class="ibox-content">
                    <div class="row">
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
								<th>订单号</th>
                                <th>客户用户名</th>
                                <th>客户电话</th>
                                <th>订单详情</th>
                                <th>收货地址</th>
                               	<th>邮编</th>
                                <th>订单建立时间</th>
                                <th>当前状态</th>
                                <th>管理</th>
                                
                                
                            </tr>
                            </thead>
                            <tbody>
                            	<c:forEach	items="${order_list}" var="order">
                            		<tr>
                            			<td>${order.orderid}</td>
                            			<td>${order.name}</td>
                            			<td>${order.phone}</td>
                            			<td>${order.bookname}-${order.bookcount}本</td>
                            			<td>${order.home}</td>
                            			<td>0${order.postcode}</td>
                            			<td>${order.ordertime}</td>
                            			<td>
                            				<c:choose>
                            					<c:when test="${order.orderstate==0}">
                            						<i class="fa fa-close text-danger"></i>
                            					</c:when>
                            					<c:otherwise>
                            						<i class="fa fa-check text-navy"></i>
                            					</c:otherwise>
                            				</c:choose>
                            			</td>
                            			<td>
                            				<c:choose>
                            					<c:when test="${order.orderstate==0}">
                            						<input type="button" class="btn btn-danger" onclick="f2(this)" value="处理">
                            					</c:when>
                            					<c:otherwise>
                            						<input type="button" class="btn btn-primary" value="无需处理">
                            					</c:otherwise>
                            				</c:choose>
                            				
                            			</td>
		                            </tr>
                            		
                            	</c:forEach>
                            </tbody>
                        </table>
                        <div id="split"></div>
						<div class="col-sm-4 col-sm-offset-2">
                           <button class="btn btn-primary" type="button" onclick="f1()" >查看历史订单</button>
                       
                        </div>
                    </div>
                </div>
            </div>
	<jsp:include page="/_layout/_script.jsp" />
	<!-- Peity -->
	<script src="${ctx}/js/plugins/peity/jquery.peity.min.js"></script>

	<!-- iCheck -->
	<script src="${ctx}/js/plugins/iCheck/icheck.min.js"></script>

	<!-- Peity -->
	<script src="${ctx}/js/demo/peity-demo.js"></script>
	<script type="text/javascript"
		src="${ctx}/js/plugins/jquery-bootstrap-paginatiion/jquery-bootstrap-pagination.js"></script>
	<script type="text/javascript">
		function f1(){
			layer.open({
				type:1,
				content:$('#pop')
			});
			}
		
		
	</script>
	<script >
	$("#split").pagination({
		  total_pages: ${pageCount},
		  current_page: ${pageNum},
		  next: "下一页",
		  prev: "上一页",
		  display_max: 4,
		  ignore_single_page: false,
		  callback: function(event, page) {
			  location = "${ctx}/servlet/OrderServlet?pageNum="+page;
		  }
	});
	</script>	
</body>
<div class="col-sm-12" id="pop" style="display: none;">
            <div class="ibox float-e-margins">
                
                <div class="ibox-content">
                    <form class="form-horizontal" action="${ctx}/servlet/AddBookType">
                        <p>请填写需要添加的图书类</p>
                        <div class="form-group">
                            <label class="col-sm-4 control-label" style="padding-right: 0px; padding-left: 0px;">图书类名：</label>

                            <div class="col-sm-8">
                                <input type="text" placeholder="图书类" class="form-control" name="bookType" style="padding: 0px;"> 
                            </div>
                        </div>
                       
                       <div class="form-group">
                          <div class="col-sm-offset-3 col-sm-8">
                          <button class="btn btn-sm btn-white" type="submit"  style="border-color: #18a689;background-color:#18a689;color:#FFF;">确定添加</button>
                       </div>
                   </div>
              </form>
          </div>
      </div>
   </div>

</html>